//package com.kxf.androidtestdemo;
//
//import android.app.Application;
//import android.content.Context;
//import android.util.Log;
//
//import androidx.annotation.Nullable;
//
//import com.facebook.react.ReactApplication;
//import com.facebook.react.ReactInstanceManager;
//import com.facebook.react.ReactNativeHost;
//import com.facebook.react.ReactPackage;
//import com.facebook.react.shell.MainReactPackage;
//import com.facebook.soloader.SoLoader;
//import com.kxf.androidtestdemo.rn.MyReactPackage;
//
//import java.lang.reflect.InvocationTargetException;
//import java.util.Arrays;
//import java.util.List;
//
//public class MainRnApplication extends Application implements ReactApplication {
//
//    private static final String TAG = "MainRnApplication";
//
//    private final ReactNativeHost mReactNativeHost =
//            new ReactNativeHost(this) {
//                @Override
//                public boolean getUseDeveloperSupport() {
//                    return BuildConfig.DEBUG;
//                }
//
//                @Override
//                protected List<ReactPackage> getPackages() {
////                    @SuppressWarnings("UnnecessaryLocalVariable")
////                    List<ReactPackage> packages = new PackageList(this).getPackages();
////                    // Packages that cannot be autolinked yet can be added manually here, for example:
////                    // packages.add(new MyReactNativePackage());
////                    Log.d(TAG, "packages=" + packages);
////                    return packages;
//                    return Arrays.<ReactPackage>asList(new MainReactPackage(), new MyReactPackage());
//                }
//
//                @Override
//                protected String getJSMainModuleName() {
//                    return "index";
//                }
//
//                @Nullable
//                @Override
//                protected String getBundleAssetName() {
//                    return "index.bundle";
//                }
//            };
//
//    @Override
//    public ReactNativeHost getReactNativeHost() {
//        return mReactNativeHost;
//    }
//
//    @Override
//    public void onCreate() {
//        super.onCreate();
//        SoLoader.init(this, /* native exopackage */ false);
//        initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
//    }
//
//    /**
//     * Loads Flipper in React Native templates. Call this in the onCreate method with something like
//     * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
//     *
//     * @param context
//     * @param reactInstanceManager
//     */
//    private static void initializeFlipper(
//            Context context, ReactInstanceManager reactInstanceManager) {
//        if (BuildConfig.DEBUG) {
//            try {
//        /*
//         We use reflection here to pick up the class that initializes Flipper,
//        since Flipper library is not available in release mode
//        */
//                Class<?> aClass = Class.forName("com.kxf.androidtestdemo.rn.ReactNativeFlipper");
//                aClass
//                        .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
//                        .invoke(null, context, reactInstanceManager);
//            } catch (ClassNotFoundException e) {
//                e.printStackTrace();
//            } catch (NoSuchMethodException e) {
//                e.printStackTrace();
//            } catch (IllegalAccessException e) {
//                e.printStackTrace();
//            } catch (InvocationTargetException e) {
//                e.printStackTrace();
//            }
//        }
//    }
//}
